//
//  FCSRBaseViewController.h
//  FCIntegral
//
//  Created by sobey on 2020/1/3.
//  Copyright © 2020 ZhouYou. All rights reserved.
//


#import <SBCSDK/SBCSDK.h>
#import <FCSRTools/FCSRCommonTools.h>
#import <FCSRTools/FCSRPop.h>
#import <FCSRTools/FCSRRequestCancelManager.h>
#import <DZNEmptyDataSet/UIScrollView+EmptyDataSet.h>
#import <MJRefresh/MJRefresh.h>

typedef NS_ENUM(NSInteger, EmptyDataState) {
    EmptyDataStateLoading = 0,
    EmptyDataStateEnd,
    EmptyDataStateError,
    EmptyDataStateNotOpen,
};

NS_ASSUME_NONNULL_BEGIN

@interface FCSRBaseViewController : SBCViewController

@property (nonatomic, strong) NSMutableArray *dataArray;
@property (nonatomic, assign) NSInteger page;
@property (nonatomic, assign) NSInteger pageSize;

@property (nonatomic, assign) EmptyDataState emptyState;
//empty
@property (nonatomic, copy) NSString *nodataStr;
@property (nonatomic, copy) NSString *nodataImgStr;
@property (nonatomic, copy) NSString *nodataButtonStr;
//是否进入页面需要刷新
@property (nonatomic, assign) BOOL isNeedMj_headerRefresh;

//蒙层View
@property (nonatomic, strong) UIView *maskView;
//蒙层是否可以点击
@property (nonatomic, assign) BOOL maskViewIsEnabled;

/**
  isEmptyLoad = YES 显示加载视图
  isEmptyLoad = NO 不显示加载视图
 */
@property (nonatomic,assign) BOOL isEmptyLoad;

/**
   添加白色返回按钮
 */
- (UIBarButtonItem*)addLeftBackBtn;
/**
  点击返回按钮
 */
- (void)onBackClick:(UIButton*)button;

/**
  根据图片，添加UIBarButtonItem
 */
- (UIBarButtonItem *)addBarBtnWithImage:(NSString *)image;

/**
   点击UIBarButtonItem的block
 */
@property (nonatomic,copy) void (^barBtnBlock)(void);

/**
 视图将要显示方法
 */
- (void)FCSR_WillAppear;
/**
 设置导航按钮
 */
- (void)FCSR_setNavItem;
/**
 请求数据
 */
- (void)FCSR_requestData;
/**
 添加下拉刷新
 */
- (void)FCSR_addRefreshHeader;
/**
 添加上拉加载
 */
- (void)FCSR_addRefreshFooter;
/**
 绑定 tableView
 */
- (void)FCSR_bindTableView;


/**
 绑定 collectionView
 */
- (void)FCSR_bindCollectionView;
/**
 添加 collectionView 下拉刷新
 */
- (void)FCSR_addCollectionViewRefreshHeader;
/**
 添加 collectionView 上拉加载
 */
- (void)FCSR_addCollectionViewRefreshFooter;

#pragma mark - maskView
/**
 展示蒙层
 */
- (void)showMaskView;
/**
 隐藏蒙层
 */
- (void)hiddenMaskView;

/**
 弹出view

 */
- (void)showAnimationWithView:(UIView *)view toRect:(CGRect )rect;

/**
 隐藏view

 */
- (void)closeAnimationWithView:(UIView *)view
                       success:(void (^)(void))success;

@end

NS_ASSUME_NONNULL_END

